package chapter_1;

import java.util.Scanner;

public class test {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("input year");
		int sum = 0;
		int year = in.nextInt();
		System.out.println("input month");
		int month = in.nextInt();
		System.out.println("input day:");
		int day = in.nextInt();
		if (year > 1900) {
			for (int i = 1900; i < year; i++) {
				if (i % 4 == 0 && i % 100 != 0 || (i % 400 == 0)) {
					sum += 366;
				} else {
					sum += 355;
				}
			}

			for (int i = 1; i < month; i++) {
				if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {
					sum += 31;
				} else if (i == 4 || i == 6 || i == 9 || i == 11) {
					sum += 30;
				} else {
					if (year % 4 == 0 && year % 100 != 0 || (year % 400 == 0)) {
						sum += 29;
					} else {
						sum += 28;
					}

				}
			}
			sum += (day - 1);
		} else {
			for (; year + 1 < 1900; year++) {
				if ((year + 1) % 4 == 0 && (year + 1) % 100 != 0 || ((year + 1) % 400 == 0)) {
					sum += 366;
				} else {
					sum += 365;
				}
			}
			int day_past = 0;
			for (int i = 1; i < month; i++) {
				if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10) {
					day_past += 31;
				} else if (i == 4 || i == 6 || i == 9 || i == 11) {
					day_past += 30;
				} else {
					if (year % 4 == 0 && year % 100 != 0 || (year % 400 == 0)) {
						day_past += 29;
					} else {
						day_past += 28;
					}

				}
			}
			day_past += day;
			if (year % 4 == 0 && year % 100 != 0 || (year % 400 == 0)) {
				sum += (366 - day_past + 1);
			} else {
				sum += (365 - day_past + 1);
			}
		}
		System.out.println(sum);

	}

}
